#include "delay.h"
#include "s3c2440_gpio.h"

#include<signal.h>
#include<errno.h>
#include<stdlib.h>
#include<unistd.h>
#include<time.h>
#include<sys/time.h>
#include<stdio.h>

int main(void) {
    gpio_init();
    printf("v9\n");
    gpio_ioctl(BLANK_GPJ, 7, TYPE_OUT);

    int ret;
#if 0 /* get the resource_clock */
    struct timespec res;
    clock_getres(CLOCK_REALTIME, &res);
    if(ret) {
        perror("clock_getres()");
        exit(EXIT_FAILURE);
    } else
        printf("clock_res sec=%ld nsec=%ld\n", (long)res.tv_sec, (long)res.tv_nsec);

    long hz;
    hz = sysconf(_SC_CLK_TCK);
    if(hz == -1)
        perror("sysconf()");
    printf("hz == %ld\n", hz);
#endif

    int i;
    for(i=0;i<1;)
    {

        int j= 0;
        //for(j = 0; j < 1*1000*1000; j++);
        gpio_write(BLANK_GPJ, 7, STATUS_HIGH);
        delay(50);
        //for(j = 0; j < 1*1000*1000; j++);
        gpio_write(BLANK_GPJ, 7, STATUS_LOW);
        delay(50);
    }

    //s3c2440_gpio_setpin(GpioBase, BLANK_GPF + 4, 4, 0);
    gpio_exit();
    return 0;
}
